#include <stdio.h>
#include <unistd.h>
#include <signal.h>

volatile int flag = 0;

void handler(int signo)
{
  flag = 1;
  printf("change flag from 0 to 1\n");
}
int main()
{
  signal(2, handler);
  while(!flag);
  printf("this process stopped normally!\n");
  return 0;
}
